# 有以下列表：list1=[7, -8, 5, 4, 0, -2, -5]
# • 正数在前负数在后
# • 整数从小到大
# • 负数从大到小
# list1 = [7, -8, 5, 4, 0, -2, -5]
# a = []
# b = []
# for i in list1:
#     if int(i) >= 0:
#         a.append(i)
#     if int(i) < 0:
#         b.append(i)
# print(sorted(a) + sorted(b, key=abs))


######################################
# 这是一个字符串排序，排序规则：小写<大写<奇数<偶数
# • s = 'asdf234GDSdsf23' #排序:小写-大写-奇数-偶数
# # • 原理：先比较元组的第一个值，FALSE
s = 'sadasASDSADFHT1236483214'
a1 = []
a2 = []
b = []
c = []
for i in list(s):
    if str(i).isdigit():
        if int(i) % 2 == 0:
            a1.append(int(i))
        else:
            a2.append(int(i))
    elif str(i).isupper():
        b.append(str(i))
    elif str(i).islower():
        c.append(i)
print(sorted(c) + sorted(b) + sorted(a2) + sorted(a1))